import { defineStore } from 'pinia';
import {DictionaryState} from '@/typings/tag/tag'
import {tagCategoryController} from "@/api/controller/tagcategory/tagCategoryController";
export const userTagStore = defineStore('dictionary', {
  state: (): DictionaryState => ({}),
  actions: {
    async fetchDictionary() {
      try {
        const res = await tagCategoryController.getTagDic()
        if (res.code === 200 ){
          this.$state = res.data
        }
      } catch (error) {
        console.error('Error fetching dictionary:', error);
      }
    },
    getAllTag(){
      return this['all'];
    },
    getAction(){
      return this['action'];
    },
    getExpression(){
      return this['expression'];
    },
    getCamera(){
      return this['camera'];
    },
    getBackground(){
      return this['background'];
    },
    getLight(){
      return this['light'];
    }
  }
});
